package com.mmz.spring.aop.support;



import com.mmz.spring.aop.Advice;
import com.mmz.spring.aop.Pointcut;

public class DefaultPointcutAdvisor extends AbstractPointcutAdvisor {

	private Advice advice;
	
	private Pointcut pointcut = Pointcut.TRUE;
	
	public DefaultPointcutAdvisor(Advice advice) {
		this(Pointcut.TRUE, advice);
	}

	
	public DefaultPointcutAdvisor(Pointcut pointcut, Advice advice) {
		this.pointcut = pointcut;
		setAdvice(advice);
	}
	
	
	public Pointcut getPointcut() {
		return this.pointcut;
	}
	
	public void setAdvice(Advice advice) {
		this.advice = advice;
	}
	
	@Override
	public Advice getAdvice() {
		return this.advice;
	}
	
	public void setPointcut(Pointcut pointcut) {
		this.pointcut = (pointcut != null ? pointcut : Pointcut.TRUE);
	}

}
